md5sum

md5sum is a computer program that calculates and verifies 128-bit MD5 hashes, as described in RFC 1321. The MD5 hash (or checksum) functions as a compact digital fingerprint of a file. As with all such hashing algorithms, there is theoretically an unlimited number of files that will have any given MD5 hash. However, it is unlikely that any two non-identical files will have the same MD5 hash.

Virtually any change to a file will cause its MD5 hash to change; therefore md5sum is used to verify the integrity of files. Most commonly, md5sum is used to verify that a file has not changed as a result of file transfer, disk error or meddling. The md5sum program is installed by default in most Unix, Linux, and Unix-like operating systems or compatibility layers. Other operating systems, including Microsoft Windows and BSD variants — such as Mac OS X - have similar utilities (see external links).

There are some graphical interfaces but it is also possible to simply run the command (which is case sensitive) followed by the filename to be checked.

The result will be displayed after a short delay. md5sum can check multiple files and direct the output to a text file as shown below:

Examples

md5sum file1 file2 > files.md5
47f4cc0b788002e8b264881beb4ec08b  file1
beaa28899c52f9df66094c4267876e78  file2
md5sum -c files.md5
file1: OK
file2: OK

See also

External links